package com.dmgis.qxfw.dataservice.businessservice.yyhb.controller;

import com.dmgis.qxfw.dataservice.businessservice.common.util.WordUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;


@Controller
@RequestMapping("/xthb")
public class export {


	/**
	 * 交互会商下载
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequestMapping(value = "download", method = RequestMethod.GET)
	public void download(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String textbox1 = request.getParameter("textbox1");//文本值
		String textbox2 = request.getParameter("textbox2");//文本值
		String textbox3 = request.getParameter("textbox3");//文本值
		String date = request.getParameter("date");//时间
		String year = date.substring(0,4);
		String mon = date.substring(5, 7);
		String day = date.substring(8, 10);
		String hour = request.getParameter("hour");//小时
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("textbox1", textbox1);
		map.put("textbox2", textbox2);
		map.put("textbox3", textbox3);
		map.put("year", year);
		map.put("mon", mon);
		map.put("day", day);
		map.put("hour", hour);
		WordUtils.exportMillCertificateWord(request, response, map);
	}
}
